<include file="Public:_header" />
<body>
<include file="Public:top" />
<div class="main-container" id="main-container">
<script type="text/javascript">
    try{ace.settings.check('main-container' , 'fixed')}catch(e){}
</script>
<div class="main-container-inner">
<a class="menu-toggler" id="menu-toggler" href="#">
    <span class="menu-text"></span>
</a>
<style type="text/css" media="screen">
.pricing-box-small{
    margin-right: 6px;
}    
</style>
<include file="Public:left" />
<div class="main-content">
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <include file="InfoType:bar" />
                <div class="widget-box">
                    <div class="widget-header header-color-blue">
                        <h5 class="bigger lighter">
                            <i class="icon-table"></i>
                            新增文章
                        </h5>
                    </div>
                    <div class="widget-body">
                        <div class="widget-main">
                        <form class="form-horizontal" method="post" action="{$do}" role="form">
                        <input type="hidden" name="id" value="{$vo.id}">
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">分类</label>
                                <div class="col-sm-2">
                                    <select data="{$vo.tid}" class="form-control" name="tid">
                                    <volist name="types" id="t">
                                        <option value="{$t.id}">{$t.title}</option>
                                    </volist>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">标题</label>

                                <div class="col-sm-9">
                                    <input type="text" value="{$vo.title}" name="title" class="input-xxlarge" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">点击</label>

                                <div class="col-sm-9">
                                    <input type="text"  value="{$vo.hits}" name="hits" class="input-small" />
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">查询关键字</label>
                                <div class="col-sm-9">
                                    <input type="text"  value="{$vo.keyword}" name="keyword" class="input-xxlarge" />
                                <span class="help-block">
                                    <span class="middle">可以设置为空,则表示不通过查询.</span>
                                </span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">图片</label>

                                <div class="col-sm-6">
                                   <div class="input-group">
                                    <input type="text"  value="{$vo.picurl}" name="picurl" class="input-large form-control" />
                                    <span to="picurl" class="input-group-addon upfile">
                                        <i class="icon-upload-alt"></i>
                                    </span>
                                    </div>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">网址</label>
                                <div class="col-sm-9">
                                    <input type="text"  value="{$vo.url}" name="url" class="input-xxlarge" />
                                <span class="help-block">
                                    <span class="middle">如果填写网址则表示不会显示内容,直接跳转到此网址</span>
                                </span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"></label>
                                <div class="col-sm-9">
                                    <include value="{$vo.desc|addslashes|filterueditor}" file="Public:ueditor" name="desc" />
                                </div>
                            </div>


                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">选项</label>
                                <div class="col-sm-2">
                                    <select data="{$vo.slide}" class="form-control" name="slide">
                                        <option value="1">在首页中显示</option>
                                        <option value="0">取消首页显示</option>
                                    </select>
                                    <span class="middle">在线首页将会以幻灯片的形式显示</span>
                                </div>
                                
                            </div>
                            <hr />
                            <div class="space-4"></div>
                            <p class="text-info">将会覆盖主页设置的默认选择</p>
                            <div class="pricing-span">
                                <div class="widget-box pricing-box-small">
                                    <div class="widget-header tplpreview header-color-red tpl_">
                                        <h5 class="bigger lighter">默认</h5>
                                    </div>
                                    <div class="widget-body">
                                        <div class="widget-main no-padding">
                                            <img width="100%" height="200px;" src="">
                                        </div>
                                        <div>
                                            <button type="button" tpl="" class="cktpl btn btn-block btn-default">
                                            <i class="icon-ok"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <volist name="tpllist" id="tpl">
                            <div class="pricing-span">
                                <div class="widget-box pricing-box-small">
                                    <div class="widget-header tplpreview header-color-grey tpl_{$tpl.tplname}">
                                        <h5 class="bigger lighter">{$tpl.tplname}</h5>
                                    </div>
                                    <div class="widget-body">
                                        <div class="widget-main no-padding">
                                            <img width="100%" height="200px;" src="{$tpl.preview}">
                                        </div>
                                        <div>
                                            <button type="button" tpl="{$tpl.tplname}" class="cktpl btn btn-block btn-default">
                                            <i class="icon-ok"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            </volist>
                            <div class="clearfix"></div>
                            <hr />
                            <input type="hidden" name="tpl" value="{$vo.tpl}">
                            <button class="btn btn-info" type="submit">
                            <i class="icon-ok bigger-110"></i>保存</button>
                        </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<include file="Public:settings" />
</div>

</div>
<include file="Public:footer" />

<script type="text/javascript">
$(function(){
    var tplname = $('input[name=tpl]').val();
    if (tplname != ""){
        $('.tpl_').removeClass('header-color-red');
        $('.tpl_'+tplname).removeClass('header-color-grey');
        $('button[tpl='+tplname+']').addClass('btn-danger');
        $('.tpl_'+tplname).addClass('header-color-red');
    } 
    $('.cktpl').on('click',function(){
        //tpl_
        tplname = $(this).attr('tpl');
        $('.tplpreview').removeClass('header-color-red');
        $('.tpl_'+tplname).removeClass('header-color-grey');
        $('.tpl_'+tplname).addClass('header-color-red');
        $('.cktpl').removeClass('btn-danger');
        $(this).addClass('btn-danger');
        $('input[name=tpl]').val(tplname);
    })
})    
</script>
</body>
</html>
